package com.example.opengl.camera

import android.opengl.GLES20
import android.opengl.GLES20.*

/**
 * @author: Mr.You
 * @create: 2023-07-19 13:07
 * @description: FBO
 **/
class TextureHelper {
    companion object{
        fun getTextures(textures:IntArray){
            glGenTextures(textures.size,textures,0)
            textures.forEach {
                //绑定纹理
                glBindTexture(GL_TEXTURE_2D,it)
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)
                //设置纹理环绕方向 x，y轴
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)
                //解绑纹理
                glBindTexture(GL_TEXTURE_2D,0)
            }
        }
    }
}